<template>
  <view></view>
</template>

<script>
export default {
  data () {
    return {
      num: null,
      shopInfo: null,
    }
  },
  onShow () {
    const _self = this
    uni.getStorage({
      key: 'shopInfo',
      success: function (res) {
        _self.shopInfo = res.data
      }
    });
    this.num = uni.getStorageSync('newsNum') || 0
    if (!this.num) {
      this.num += 1
      uni.setStorageSync('newsNum', this.num);
      window.location.href = `http://192.168.10.247:8080/?ut=1&tid=${this.shopInfo.id}&sn=${this.shopInfo.shopName}`
    } else if (parseInt(this.num) === 1) {
      uni.removeStorageSync('newsNum');
      // uni.navigateBack({
      //   delta: 1
      // });
      uni.switchTab({
        url: '/src/pages/index/index'
      });
    }

  },
}
</script>

<style>
</style>